package com.ants.user.controller;

import com.ants.common.user.User;
import com.ants.user.service.UserService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 蚂蚁会花呗
 * @create 2025/5/21 15:51
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;


    @GetMapping("getDetail")
    public List<User> getDetail(){
        return userService.list();
    }

    @PostMapping("page")
    public IPage<User> page(){
        Page<User> page = new Page<>(1,2);
        return userService.page(page);
    }


}
